www.gusucode.com > 威博多用户网上购物商城(生成html) 6 > 威博多用户网上购物商城(生成html) 6.2/威博多用户/ajax/classajax.asp

    <!--#include file=../inc/inc.asp-->
<!--#include file=../inc/conn.asp-->
<%
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.Charset="UTF-8"
Server.ScriptTimeOut=999999999
dim classid
GetType=request("GetType")
classid=request("classid")
Select case lcase(GetType)
Case "classinfo":
OpenRs
sql="select * from web_proclass where fid="&classid&" order by v_order desc"
rs.open sql,conn,1,3
do while not rs.eof 
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="25" background="<%=web_get_rootdir(web_c_setupfolder)%>images/category/sortbar.gif"><table border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td width="6"><img src="<%=web_get_rootdir(web_c_setupfolder)%>images/category/sortbar1.gif" width="6" height="25"></td>
                <td background="<%=web_get_rootdir(web_c_setupfolder)%>images/category/sortbar2.gif"><font color="#006699"><strong>- 
                  <a href="<%=web_get_rootdir(web_c_setupfolder)%>html/ms/class/<%=rs("id")%>/class_<%=rs("id")%>.html"><%=rs("name")%></a> -</strong></font></td>
                <td width="6"><img src="<%=web_get_rootdir(web_c_setupfolder)%>images/category/sortbar3.gif" width="6" height="25"></td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="5">
	   <%
		set web_rs=conn.execute("select * from web_proclass where fid="&rs("id"))
		i=0 : j=0
		do while not web_rs.eof 
			if i mod 6 = 0 then
				if (j mod 2) =0 then
					j=j+1
					response.write "<tr bgcolor='#F7F7F7'>"
				else
					response.write "<tr>"
					j=j+1
				end if
			end if
	   %>
                <td width="17%"><a href="<%=web_get_rootdir(web_c_setupfolder)%>html/ms/class/<%=web_rs("id")%>/class_<%=web_rs("id")%>.html" target=_blank><%=web_rs("name")%> <font color="#999999">(<%=Web_get_ProCount(web_rs("id"))%>)</font></td>
	   <%
		if (i+1) mod 6 = 0 then
			response.write "</tr>"
		end if
		i=i+1 
		web_rs.movenext
		loop
		web_rs.close : set web_rs=nothing
	   %>
            </table></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
<%
rs.movenext
loop
%>
<%
Case "subclassinfo":
OpenRs
sql="select * from web_proclass where fid="&classid&" order by v_order desc"
rs.open sql,conn,1,3
if rs.eof then
	closers
	response.end
end if
rs.close 
sql="select * from web_proclass where id="&classid&" order by v_order desc"
rs.open sql,conn,1,3
do while not rs.eof 
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="25" background="<%=web_get_rootdir(web_c_setupfolder)%>images/category/sortbar.gif"><table border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td width="6"><img src="<%=web_get_rootdir(web_c_setupfolder)%>images/category/sortbar1.gif" width="6" height="25"></td>
                <td background="<%=web_get_rootdir(web_c_setupfolder)%>images/category/sortbar2.gif"><font color="#006699"><strong>- 
                  <%=rs("name")%> -</strong></font></td>
                <td width="6"><img src="<%=web_get_rootdir(web_c_setupfolder)%>images/category/sortbar3.gif" width="6" height="25"></td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="5">
	   <%
		set web_rs=conn.execute("select * from web_proclass where fid="&rs("id"))
		i=0 : j=0
		do while not web_rs.eof 
			if i mod 6 = 0 then
				if (j mod 2) =0 then
					j=j+1
					response.write "<tr bgcolor='#F7F7F7'>"
				else
					response.write "<tr>"
					j=j+1
				end if
			end if
	   %>
                <td width="17%"><a href="<%=web_get_rootdir(web_c_setupfolder)%>html/ms/class/<%=web_rs("id")%>/class_<%=web_rs("id")%>.html" target=_blank><%=web_rs("name")%> <font color="#999999">(<%=Web_get_ProCount(web_rs("id"))%>)</font></td>
	   <%
		if (i+1) mod 6 = 0 then
			response.write "</tr>"
		end if
		i=i+1 
		web_rs.movenext
		loop
		web_rs.close : set web_rs=nothing
	   %>
            </table></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
<%
rs.movenext
loop
%>

<%
end select
Function Web_get_ProCount(id)
	set web_rs2=conn.execute("select count(id) as num from web_product where p_classid="&id)
	Web_get_ProCount=web_rs2("num")
	web_rs2.close : set web_rs2=nothing
End Function
%>